﻿using System;
using System.Collections.Generic;
using VASJ.Common;

namespace VASJ.Model
{
    //
    // FOR ALL USERS: C:\ProgramData\COMPANY_NAME\Configuration.xml
    // FOR ONE USER: C:\Users\USER_NAME\AppData\Local\COMPANY_NAME\Configuration.xml
    //
    [Serializable]
    [FileName(Name = "Configuration.xml")]
    public class Configuration
    {
        private string _email = "manh@add-on-development.com";
        private string _username = "manhnv";
        private string _password = "aod@123";
        private string _connectionString = "Data Source=ManhNV;Initial Catalog=KeToan;Persist Security Info=True;User ID=sa;Password=aod@123";
        private string _currentLanguage = "vi-VN";

        private List<ShortcutKey> _shortcutKeys = new List<ShortcutKey>();

        public string Email
        {
            get
            {
                return Utils.Decrypt(this._email);
            }
            set
            {
                this._email = Utils.Encrypt(value);
            }
        }

        public string Username
        {
            get
            {
                return Utils.Decrypt(this._username);
            }
            set
            {
                this._username = Utils.Encrypt(value);
            }
        }

        public string Password
        {
            get
            {
                return Utils.Decrypt(this._password);
            }
            set
            {
                this._password = Utils.Encrypt(value);
            }
        }

        public string ConnectionString
        {
            get
            {
                return Utils.Decrypt(this._connectionString);
            }
            set
            {
                this._connectionString = Utils.Encrypt(value);
            }
        }

        public string CurrentLanguage
        {
            get
            {
                return Utils.Decrypt(this._currentLanguage);
            }
            set
            {
                this._currentLanguage = Utils.Encrypt(value);
            }
        }

        public List<ShortcutKey> ShortcutKeys
        {
            get
            {
                return this._shortcutKeys;
            }
            set
            {
                this._shortcutKeys = value;
            }
        }
    }
}